
// 首页model类

class AppGridModel {
  int? errcode;
  String? errmsg;
  List<Data>? data;
  String? message;

  AppGridModel({this.errcode, this.errmsg, this.data, this.message});

  AppGridModel.fromJson(Map<String, dynamic> json) {
    errcode = json['errcode'];
    errmsg = json['errmsg'];
    if (json['data'] != null) {
      data = <Data>[];
      json['data'].forEach((v) {
        data!.add(new Data.fromJson(v));
      });
    }
    message = json['message'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['errcode'] = this.errcode;
    data['errmsg'] = this.errmsg;
    if (this.data != null) {
      data['data'] = this.data!.map((v) => v.toJson()).toList();
    }
    data['message'] = this.message;
    return data;
  }
}

class Data {
  int? categoryId;
  String? categoryName;
  List<Apps>? apps;

  Data({this.categoryId, this.categoryName, this.apps});

  Data.fromJson(Map<String, dynamic> json) {
    categoryId = json['category_id'];
    categoryName = json['category_name'];
    if (json['apps'] != null) {
      apps = <Apps>[];
      json['apps'].forEach((v) {
        apps!.add(new Apps.fromJson(v));
      });
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['category_id'] = this.categoryId;
    data['category_name'] = this.categoryName;
    if (this.apps != null) {
      data['apps'] = this.apps!.map((v) => v.toJson()).toList();
    }
    return data;
  }
}

class Apps {
  int? id;
  String? name;
  String? icon;
  bool? isActive;
  var is_focus;
  String? categoryName;
  String? typeGroup;
  String? type;
  bool? public;
  int? modelId;
  String? models;
  String? domain;
  String? context;
  String? dateStart;
  String? dateEnd;
  String? url;
  int? userId;
  String? userName;

  Apps(
      {this.id,
        this.name,
        this.icon,
        this.isActive,
        this.is_focus,
        this.categoryName,
        this.typeGroup,
        this.type,
        this.public,
        this.modelId,
        this.models,
        this.domain,
        this.context,
        this.dateStart,
        this.dateEnd,
        this.url,
        this.userId,
        this.userName});

  Apps.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    name = json['name'];
    icon = json['icon'];
    isActive = json['is_active'];
    is_focus = json['is_focus'];
    categoryName = json['category_name'];
    typeGroup = json['type_group'];
    type = json['type'];
    public = json['public'];
    modelId = json['model_id'];
    models = json['models'];
    domain = json['domain'];
    context = json['context'];
    dateStart = json['date_start'];
    dateEnd = json['date_end'];
    url = json['url'];
    userId = json['user_id'];
    userName = json['user_name'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['name'] = this.name;
    data['icon'] = this.icon;
    data['is_active'] = this.isActive;
    data['category_name'] = this.categoryName;
    data['type_group'] = this.typeGroup;
    data['type'] = this.type;
    data['public'] = this.public;
    data['model_id'] = this.modelId;
    data['models'] = this.models;
    data['domain'] = this.domain;
    data['context'] = this.context;
    data['date_start'] = this.dateStart;
    data['date_end'] = this.dateEnd;
    data['url'] = this.url;
    data['user_id'] = this.userId;
    data['user_name'] = this.userName;
    return data;
  }
}
